////////////////////////////////////////////////
// -- DepthHUD Lite                           //
// by Hurricaaane (Ha3)                       //
//                                            //
// http://www.youtube.com/user/Hurricaaane    //
//--------------------------------------------//
// Base panel                                 //
////////////////////////////////////////////////

local PANEL = {}

function PANEL:Init()
	self:SetMainType( "number" )
	self:SetMainColor( color_white )
	self:UpdateMainFont( )
	
	self:SetSubText( "ARMOR" )
	
end

function PANEL:Think()
	if LocalPlayer and ValidEntity( LocalPlayer() ) then
	    local iArmor = LocalPlayer():Armor()
		if iArmor > 0 then
		    if self:IsHidden() then
				self:Show()
				
			end
			self:SetRate( iArmor / 100 )
			self:SetMainText( iArmor )
			
		elseif iArmor <= 0 and not self:IsHidden() then
		    self:Hide()
			self:SetRate( 0 )
			self:SetMainText( 0 )
			
		end
		
	end
	
end

derma.DefineControl( "DHUI_Armor", "", PANEL, "HIndicatorLabel" )
